home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / POV-Ray Build Extras / Magic Lamp / Magic Lamp.POV < prev    next >
Encoding:
Text File  |  1997-01-18  |  6.3 KB  |  276 lines  |  [TEXT/POV3]

  1. // Persistence of Vision RayTracer Scene description file
  2. // File: Magic Lamp.pov
  3. // Version: 3
  4. // Description: Arabian "Genie" style magic lamp, with smoke
  5. //    rising into the letters "POV-Ray".  This is used as the
  6. //    splash-screen & about box graphic for POV-Ray 3.
  7. //    Best viewed at a 2/1 ratio (e.g. 400x200)
  8. // Date: 950219 - Updated 970118
  9. // Author: Eduard Schwan
  10. //
  11.  
  12. // ----------------------------------------------------------
  13. // USER FLAGS: Set to 0 to turn off, 1 to turn on
  14. // ----------------------------------------------------------
  15. #declare DO_WALL    = 1
  16. #declare DO_SMOKE   = 1
  17. #declare DO_LETTERS = 1
  18. #declare DO_LAMP    = 1
  19. #declare DO_VIGNETTE= 0
  20.  
  21.  
  22. // ----------------------------------------------------------
  23. // Standard POV-Ray Includes
  24. // ----------------------------------------------------------
  25.  
  26. #include "colors.inc"      // Standard Color definitions
  27. #include "metals.inc"      // Standard Texture definitions
  28.  
  29.  
  30. global_settings
  31. {
  32.   assumed_gamma 1.0
  33. }
  34.  
  35.  
  36. // ----------------------------------------------------------
  37. //  Camera
  38. // ----------------------------------------------------------
  39.  
  40. #declare CameraPos = <0.0, 1.0, -11.0>
  41. camera
  42. {
  43.   location  CameraPos
  44. #if (DO_VIGNETTE=1)
  45.   angle     40
  46. #else
  47.   angle     25
  48. #end
  49.   right     2*x              // which way is +right <X Y Z> and aspect ratio
  50.   look_at   <0.0, 1.0,  0.0> // point center of view at this point <X Y Z>
  51. }
  52.  
  53. // ----------------------------------------------------------
  54. //  Lights
  55. // ----------------------------------------------------------
  56.  
  57. // above
  58.  light_source { 0*x color Gray30             translate <  0, 90, 10> }
  59. // below
  60.  light_source { 0*x color rgb <0.0,0.1,0.3>  translate <  0, -5,  0> }
  61. // front/above
  62.  light_source { 0*x color Gray20             translate <  0, 30, -15> }
  63.  
  64.  
  65. // ----------------------------------------------------------
  66. //  Vignette (Frame) around view
  67. // ----------------------------------------------------------
  68.  
  69. #if (DO_VIGNETTE)
  70. #declare CylRad = 0.08
  71. #declare SphereRad = CylRad*2
  72. #declare FrameNFlash = union
  73. {
  74.   // the knobby frame
  75.   blob
  76.   {
  77.   threshold 0.1
  78.  
  79.   sphere   { <-1,-0.5,0> SphereRad, 1}
  80.   cylinder { <-1,-0.5,0> <+1,-0.5,0> CylRad, 1}
  81.  
  82.   sphere   { <+1,-0.5,0> SphereRad, 1}
  83.   cylinder { <+1,-0.5,0> <+1,+0.5,0> CylRad, 1}
  84.  
  85.   sphere   { <+1,+0.5,0> SphereRad, 1}
  86.   cylinder { <+1,+0.5,0> <-1,+0.5,0> CylRad, 1}
  87.  
  88.   sphere   { <-1,+0.5,0> SphereRad, 1}
  89.   cylinder { <-1,+0.5,0> <-1,-0.5,0> CylRad, 1}
  90.  
  91.   texture
  92.     {
  93.     pigment { color rgb <0.9, 0.9, 1.0> }
  94. //    pigment { color rgb <0.5, 0.3, 0.2> }
  95.     normal { ripples 0.3 scale 0.05 }
  96.     finish { ambient 0.3 specular 0.4 irid { 0.3  thickness 0.2 turbulence 1 } }
  97.     }
  98.   }
  99.  
  100.   // some white flashing just outside the frame to give an outer white border
  101.   intersection
  102.   {
  103.   box { <-1.3,-0.8, 0.0> <1.3,0.8,0.1> }         // outer box
  104.   box { <-1.0,-0.5,-0.1> <1.0,0.5,0.2> inverse } // inner box/hole
  105.   // pure flat white
  106.   texture { pigment {color rgb 1} finish {ambient 1 diffuse 0} }
  107.   }
  108.  
  109.   // For some weird reason, there's a little more room on the sides
  110.   // than on the top/bottom (even though it is exactly 2:1),
  111.   // so we just stretch the frame out a little to fit better.
  112.   scale <1.15, 1, 1>
  113. }
  114.  
  115. object
  116. {
  117.   FrameNFlash
  118.   translate CameraPos+2.5*z
  119. }
  120.  
  121. #end
  122.  
  123.  
  124. // ----------------------------------------------------------
  125. //  Sky
  126. // ----------------------------------------------------------
  127.  
  128. sky_sphere
  129. {
  130.     pigment
  131.     {
  132.       gradient y
  133.       color_map {
  134. /* too garish
  135.       [0.1  red  0.8]
  136.       [0.2  red  0.4]
  137.       [0.4  red  0.1]
  138.       [0.45 blue 0.2]
  139.       [0.5  blue 0.2]
  140.       [0.6  blue 0.5]
  141.       [0.7  blue 1.0]
  142.       [1.0  White]
  143. */
  144.       [0.4  rgb  <0.6,0.4,0.2>]  // brown
  145.       [0.45 blue 0.3]
  146.       [0.5  blue 0.4]
  147.       [0.6  blue 0.5]
  148.       [0.7  rgb <0.3,0.5,0.7>]
  149.       [1.0  White]
  150.     }
  151.   scale 2 translate -1*y
  152.   }
  153. }
  154.  
  155. // ----------------------------------------------------------
  156. //  Back wall
  157. // ----------------------------------------------------------
  158.  
  159. #if (DO_WALL)
  160. #declare Crackle_Scale = 0.8
  161. #declare Crackle_Turb  = 0.2
  162. plane
  163. {
  164.   z, 10
  165.   hollow
  166.   texture
  167.   { 
  168.   pigment
  169.   {
  170.     crackle turbulence Crackle_Turb scale Crackle_Scale scale <2,1,-1>
  171.     color_map
  172.     {
  173. //      [0.10 blue 0.10]
  174.       [0.05 blue 0.15]
  175.       [0.10 blue 0.20]
  176.       [0.15 blue 0.30]
  177. //      [0.25 blue 0.70]
  178.     }
  179.   }
  180.   normal
  181.   {
  182.     crackle turbulence Crackle_Turb scale Crackle_Scale scale <2,1,-1>
  183.     bump_size 0.8
  184.   }
  185.   finish { ambient 0.1 specular 0.6 }
  186.   rotate 5*z translate -1.5*y // move it down to obscure origin seam
  187.   }
  188. }
  189. #end
  190.  
  191. // ----------------------------------------------------------
  192. //   The Lamp
  193. // ----------------------------------------------------------
  194.  
  195. #if (DO_LAMP)
  196. #declare Lamp_Texture =
  197. // texture { Gold_Metal }
  198. texture { T_Brass_4B  }
  199.  
  200. #include "Magic Lamp.inc"
  201. object
  202. {
  203.   Magic_Lamp
  204. //  rotate <-10,-10,0>
  205.   rotate <-20,-15,0>
  206.   translate 1*y
  207. }
  208. #end
  209.  
  210.  
  211. // ----------------------------------------------------------
  212. //   Smoke
  213. // ----------------------------------------------------------
  214.  
  215. #if (DO_SMOKE)
  216. #include "Smoke.inc"
  217. object { Smoke_Shape texture {Smoke_Texture} translate <-2.6, -0.7+1, 0.0> }
  218. #end
  219.  
  220.  
  221. // ----------------------------------------------------------
  222. //   POV-Ray lettering
  223. // ----------------------------------------------------------
  224.  
  225. // texture for letters
  226. #declare Letter_Shade = color rgb <1.00, 0.90, 0.80>
  227. #declare Lettering_Texture =
  228. texture
  229. {
  230.   pigment
  231.   {
  232.     marble turbulence <0.4,0.2,0.4> rotate -5*z translate 0.3*x
  233.     color_map
  234.     {
  235.       [0.60 Letter_Shade]
  236.       [0.66 Gray20]
  237.       [0.70 Letter_Shade]
  238.       [0.75 Letter_Shade]
  239.       [0.80 rgb  <0.8, 0.7, 0.7>]
  240.       [0.90 rgbf 1]
  241.       [0.95 rgb  <0.7, 0.8, 0.7>]
  242.       [1.00 rgb  <0.5, 0.3, 0.1>]
  243.     }
  244.     scale 0.15
  245.   }
  246.   finish { ambient 1 diffuse 0 }
  247. }
  248.  
  249. #if (DO_LETTERS)
  250. #declare POVLetters_Shape =
  251. plane { z, 0.0 bounded_by { box{-1.1, +1.1} } }
  252.  
  253. #declare POVLetters_Texture =
  254. texture
  255. {
  256.   material_map
  257.   {
  258.   gif "POVLetters.gif" // the file to read (iff/gif/tga/dump/pot)
  259.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  260.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  261.   once
  262.   texture { pigment {Clear} }  // texture for color index # 0
  263.   texture { Lettering_Texture  }  // texture for color index # 1
  264.   } // material_map
  265.   translate -0.5*(x+y) scale 2 // unitize
  266. }
  267.  
  268.  
  269. object
  270. {
  271.   POVLetters_Shape texture {POVLetters_Texture}
  272.   scale <3,1,1> translate <0, 2.2, 0>
  273. }
  274. #end
  275.  
  276.